mod front_of_mod;
use crate::front_of_mod::traffic_light::Light;
use crate::front_of_mod::traffic_light as light;
use std;


fn main() {

    println!("----------first------------");

    let green_light = light::TrafficLight::Green;
    println!("green light time is: {}",green_light.return_time());
    let yellow_light = light::TrafficLight::Yellow;
    println!("yellow light time is: {}",yellow_light.return_time());
    let red_light = light::TrafficLight::Red;
    println!("red light time is: {}",red_light.return_time());
    

    println!("----------second------------");
    let s:[u32;5] = [1,2,3,4,5];
    let sum = front_of_mod::sum_of_slice::sum_of_u32(&s);
    println!("the un-overflow sum of slice is {:?}",sum.unwrap());

    let s:[u32;5] = [1,2,3,4,std::u32::MAX];
    let sum = front_of_mod::sum_of_slice::sum_of_u32(&s);
    println!("the overflow sum of slice is None({:?})",sum.unwrap_or(0));



    println!("----------third------------");
    let circle = front_of_mod::graph::Graph::Circle(1.0);
    println!("the area of circle {:?} is {:?}",circle,front_of_mod::graph::get_area(&circle));
    let square = front_of_mod::graph::Graph::Square(1.0,2.0);
    println!("the area of square {:?} is {:?}",square,front_of_mod::graph::get_area(&square));
    let triangle = front_of_mod::graph::Graph::Triangle(3.0,4.0,5.0);
    println!("the area of triangle {:?} is {:?}",triangle,front_of_mod::graph::get_area(&triangle));

}
